package dper.study.codes.concurrent.worker;

import dper.study.codes.concurrent.model.ProConBuffer;
import dper.study.codes.concurrent.model.ProConBufferWaitNotifyAll;

/**
 * Created by leichen on 2017/3/20.
 */
public class Consumer implements Runnable {
    private ProConBuffer proConBuffer ;

    public Consumer(ProConBuffer proConBuffer){
        this.proConBuffer = proConBuffer ;
    }

    public void run() {
        while(true){
            try {
                proConBuffer.get() ;
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            Thread.yield();
        }
    }
}
